#include "FastLED.h"            // 此示例程序需要使用FastLED库
#define NUM_LEDS 17             // LED灯珠数量
#define DATA_PIN 5              // Arduino输出控制信号引脚
#define LED_TYPE WS2812         // LED灯带型号
#define COLOR_ORDER GRB         // RGB灯珠中红色、绿色、蓝色LED的排列顺序
 
uint8_t max_bright = 64;       // LED亮度控制变量，可使用数值为 0 ～ 255， 数值越大则光带亮度越高
CRGB leds[NUM_LEDS];            // 建立灯带leds

#define LED_RL_PIN  27
#define LED_RD_PIN  26
#define LED_RR_PIN  25
#define LED_RU_PIN  33
CFastLED LED_RL;
CRGB leds_rl[NUM_LEDS];            // 建立灯带leds
CFastLED LED_RD;
CRGB leds_rd[NUM_LEDS];            // 建立灯带leds
CFastLED LED_RR;
CRGB leds_rr[NUM_LEDS];            // 建立灯带leds
CFastLED LED_RU;
CRGB leds_ru[NUM_LEDS];            // 建立灯带leds

#define LED_LL_PIN 5
#define LED_LD_PIN 18
#define LED_LR_PIN 19
#define LED_LU_PIN 21

CFastLED LED_LL;
CRGB leds_ll[NUM_LEDS];            // 建立灯带leds
CFastLED LED_LD;
CRGB leds_ld[NUM_LEDS];            // 建立灯带leds
CFastLED LED_LR;
CRGB leds_lr[NUM_LEDS];            // 建立灯带leds
CFastLED LED_LU;
CRGB leds_lu[NUM_LEDS];            // 建立灯带leds




void setup() 
{ 

  LED_RL.addLeds<WS2812,LED_RL_PIN, COLOR_ORDER>(leds_rl, NUM_LEDS);
  LED_RD.addLeds<WS2812,LED_RD_PIN, COLOR_ORDER>(leds_rd, NUM_LEDS);
  LED_RR.addLeds<WS2812,LED_RR_PIN, COLOR_ORDER>(leds_rr, NUM_LEDS);
  LED_RU.addLeds<WS2812,LED_RU_PIN, COLOR_ORDER>(leds_ru, NUM_LEDS);

  LED_LL.addLeds<WS2812,LED_LL_PIN, COLOR_ORDER>(leds_ll, NUM_LEDS);
  LED_LD.addLeds<WS2812,LED_LD_PIN, COLOR_ORDER>(leds_ld, NUM_LEDS);
  LED_LR.addLeds<WS2812,LED_LR_PIN, COLOR_ORDER>(leds_lr, NUM_LEDS);
  LED_LU.addLeds<WS2812,LED_LU_PIN, COLOR_ORDER>(leds_lu, NUM_LEDS);

  LEDS.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);  // 初始化灯带
  FastLED.setBrightness(max_bright);                            // 设置灯带亮度


}
 
void loop() { 
 for (int i = 0; i < NUM_LEDS; i++)
  {
      leds_rl[i] = CRGB::Green;
      leds_rd[i] = CRGB::Green;
      leds_rr[i] = CRGB::Green;
      leds_ru[i] = CRGB::Green;
      leds_ll[i] = CRGB::Green;
      leds_ld[i] = CRGB::Green;
      leds_lr[i] = CRGB::Green;
      leds_lu[i] = CRGB::Green;
  }
  FastLED.show();               // 更新LED色彩
  // delay(500);                   // 等待500毫秒
  // for (int i = 0; i < NUM_LEDS; i++)
  // {
  //     leds_rl[i] = CRGB::Black;
  //     leds_rd[i] = CRGB::Black;
  //     leds_rr[i] = CRGB::Black;
  //     leds_ru[i] = CRGB::Black;
  // }
  // FastLED.show();               // 更新LED色彩
  delay(500);                   // 等待500毫秒
}
